﻿@model ContactManagement.Models.DynamicData.DynamicDataListModel
@{
    ViewBag.Title = GlobalResources.PageTitles.DynamicDataTypeManagementRESX;
}

<div class="span12">
    <h2>@GlobalResources.PageTitles.DynamicDataTypeManagementRESX</h2>
    <hr />
</div>

<div class="span12">
    <table class="table table-striped @WebConstants.FilterTableRowsCssClass">
        <thead>
            <tr>
                <th>
                    @GlobalResources.AccountViews.OptionsRESX
                </th>
                <th>
                    @Html.TableHeaderLinks("Name", GlobalResources.AdminViews.DynamicDataNameShortRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("DynamicDataType", GlobalResources.AdminViews.DynamicDataTypeRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("Module", GlobalResources.AdminViews.DynamicDataAssignedModuleRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("DynamicDataTypeCategory", GlobalResources.AdminViews.DynamicDataAssignedCategoryRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("HasUserGroups", GlobalResources.AdminViews.DynamicDataGroupRightsAssignedRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("IsVisible", GlobalResources.AdminViews.IsVisibleRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("IsRequired", GlobalResources.AdminViews.IsRequiredShortRESX).CreateSortLink()
                </th>
                <th>
                    @Html.TableHeaderLinks("SortId", GlobalResources.AdminViews.AnzeigePositionShortRESX).CreateSortLink()
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.DynamicDataTypes)
            {
                <tr>
                    <td>
                        @Html.ActionLink(" ", EActionDynamicData.DynamicDataTypeDelete.ToString(), new { id = item.ID }, new { @class = "btn btn-mini", data_icon = "icon-trash", title = GlobalResources.Navigation.DeleteRESX })
                        @Html.ActionLink(" ", EActionDynamicData.DynamicDataTypeEdit.ToString(), new { id = item.ID }, new { @class = "btn btn-mini", data_icon = "icon-pencil", title = GlobalResources.Navigation.EditRESX })
                        @Html.ActionLink(" ", EActionDynamicData.EditGroupRights.ToString(), new { id = item.ID }, new { @class = "btn btn-mini", data_icon = "icon-user", title = GlobalResources.Navigation.DynamicDataEditGroupRightsRESX })
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @item.GetDynamicDataTypeName()
                    </td>
                    <td>
                        @EFDataModel.EFBase.GetModuleName(item.Module)
                    </td>
                    <td>
                        @Html.Categories().DisplayForCategory(item.DynamicDataTypeCategoryID.ToString())
                    </td>
                    <td>
                        @Html.DisplayForYesNo(item.HasUserGroups)
                    </td>
                    <td>
                        @Html.DisplayForYesNo(item.IsVisible)
                    </td>
                    <td>
                        @Html.DisplayForYesNo(item.IsRequired)
                    </td>
                    <td>
                        @Html.DisplayFor(model => item.SortId)
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

<div class="span12">
    <div class="well">
        @Html.ActionLink(GlobalResources.Navigation.CreateRESX, EActionDynamicData.DynamicDataTypeAdd.ToString(),null, new { @class = "btn btn-small" })
    </div>
</div>

